package com.ean.backpack.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ean.backpack.domain.Roomtypelist;
import com.ean.backpack.domain.RoomtypelistPK;
import com.ean.backpack.repository.RoomtypelistRepository;
import com.ean.backpack.service.RoomtypelistService;

@Service
@Transactional
public class RoomtypelistServiceImpl implements RoomtypelistService {

	@Autowired
	RoomtypelistRepository roomtypelistRepository;

	public long countAllRoomtypelists() {
		return roomtypelistRepository.count();
	}

	public void deleteRoomtypelist(Roomtypelist roomtypelist) {
		roomtypelistRepository.delete(roomtypelist);
	}

	public Roomtypelist findRoomtypelist(RoomtypelistPK id) {
		return roomtypelistRepository.findOne(id);
	}

	public List<Roomtypelist> findAllRoomtypelists() {
		return roomtypelistRepository.findAll();
	}

	public List<Roomtypelist> findRoomtypelistEntries(int firstResult,
			int maxResults) {
		return roomtypelistRepository.findAll(
				new org.springframework.data.domain.PageRequest(firstResult
						/ maxResults, maxResults)).getContent();
	}

	public void saveRoomtypelist(Roomtypelist roomtypelist) {
		roomtypelistRepository.save(roomtypelist);
	}

	public Roomtypelist updateRoomtypelist(Roomtypelist roomtypelist) {
		return roomtypelistRepository.save(roomtypelist);
	}
}
